Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UK24] Reproduction #161

Closed
wants to merge 12 commits into from
Closed

[UK24] Reproduction #161

wants to merge 12 commits into from

Conversation

cmaumet
Copy link
Contributor

@cmaumet cmaumet commented Feb 12, 2024

This Pull Request is related to issue #60.

Changes proposed in this Pull Request:

  • SPM configuration file (matlabbatch) tracing the different options chosen by the team

Checklist:

  • Descriptive title
  • Targets the main branch
  • Changes are functional
  • My code is explicit and comments were added to it
  • Code conforms with PEP8
  • Tests were added for the changes and they complete successfully
  • Existing tests were updated (if needed) and they complete successfully
  • Documentation was updated

@cmaumet
Copy link
Contributor Author

cmaumet commented Feb 12, 2024

@bclenet: This PR includes pseudo-code to reproduce the preprocessing and the subject-level statistical analysis (the group level should be identical to other SPM team). Can I leave it to you to translate this onto nipype? Happy to help if youb have any questions on the parametrization done in the matlabbatch. Thanks!

@cmaumet
Copy link
Contributor Author

cmaumet commented Feb 13, 2024

I am keeping notes of some thoughts I had after completing the batch:

Part of the reproduction that we could adapt:

  • Rather than redoing the calculation of mean signal in WM and CSF we could take directly in fmriprep data (this might be what the authors did since we have little details on how those were computed -- @bclenet )

Things to check if the correlations are not as expected:

  • use of sbref if the multi-run analysis at the subject-level. Should we modify the onsets accordingly given that we have added 4 volumes?

% no-loss-nor-gain block-task regressor a single extra parametric
% modulation regressor was added to model the parametric size of the
% reaction time.
% All parametric modulation regressors were mean centered
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the mean value computed for each run, or one for all runs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bclenet 'mean centering' should be done automatically as part of the design (this is an option in the model). I can't open Matlab (no more licenses) but I'll check as soon as I can :)

matlabbatch{end+1}.spm.stats.fmri_spec.dir = '<UNDEFINED>';
matlabbatch{end}.spm.stats.fmri_spec.timing.units = 'secs';
matlabbatch{end}.spm.stats.fmri_spec.timing.RT = '<UNDEFINED>';
matlabbatch{end}.spm.stats.fmri_spec.timing.fmri_t = 16;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of these parameters (fmri_t and fmri_t0) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something I should have removed from the matlabbatch as this is just the default value.

For info (as this might be useful for other parameters), each parameter of fMRI specification is described in this file: https://github.com/spm/spm12/blob/main/config/spm_cfg_fmri_spec.m (and in correspondant spm_cfg_xxx for each of the matlabbatch modules).

% Below we should include the 'onset' values from sub-001_task-MGT_run-01_events
% for which we have participant_response=accept (either weakly or strongly)
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(2).onset = '<UNDEFINED>';
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(2).duration = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the duration should be 4, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think you are right!

% Below we should include the 'RT' values from sub-001_task-MGT_run-01_events
% for which we have participant_response=reject (either weakly or strongly)
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(3).onset = '<UNDEFINED>';
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(3).duration = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the duration should be 4, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, same!


% 4 - Functional MRI volume realignment: first realigning all 4 'sbref'
% images to the one acquired before the first run; followed by realignment
% of all volumes in a particular run to the first image in that run.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, first image in that run does not refer to the sbref file, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Though the first image in the run and the sbref should be very close.

% for which we have participant_response=accept (either weakly or strongly)
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(2).pmod(2).param = '<UNDEFINED>';
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(2).pmod(2).poly = 1;
matlabbatch{end}.spm.stats.fmri_spec.sess.cond(2).orth = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find the corresponding parameter in nipype

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding this thread @bclenet! As far as I can tell here we are trying to keep the orthogonolisation which seems to be the default (it looks like it's the switching off that is not implemented yet). If that's true then we should be able to proceed.

@bclenet bclenet mentioned this pull request Feb 23, 2024
8 tasks
@bclenet
Copy link
Collaborator

bclenet commented May 7, 2024

Closing this PR, as the matlab code was ported to #179

@bclenet bclenet closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants